package ma.ac.onousc.gestionfi.EngagementPaiement.model.DAO.DAOBean;

import java.util.List;

import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;

import ma.ac.onousc.gestionfi.EngagementPaiement.model.Marche;
import ma.ac.onousc.gestionfi.EngagementPaiement.model.DAO.MarcheDAO;
import ma.ac.onousc.gestionfi.budget.model.RubriqueBudgetaire;
import ma.ac.onousc.gestionfi.budget.model.DAO.DAOBean.GenericEJB3Bean;

@Stateless
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
public class MarcheDAOBean extends GenericEJB3Bean<Marche, Integer> implements
MarcheDAO {

	@SuppressWarnings("unchecked")
	@Override
	public List<Marche> findByRB(RubriqueBudgetaire rb) {
		return this.getEntityManager().createNamedQuery("Marche.findByRB")
				.setParameter("rb", rb).getResultList();
	}

}